{include file="public/head"}

<body>
<div id="wrapper">

    <div class="gray-bg dashbard-1">
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-content">
                            <div class="form-horizontal m-t">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">反馈时间：</label>
                                    <div class="col-sm-8">
                                        <input  type="text" class="form-control" readonly value="{$FeedbackInfo.add_time|date='Y-m-d H:i:s',###}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">反馈内容：</label>
                                    <div class="col-sm-8">
                                        <textarea class="form-control" rows="8" readonly >{$FeedbackInfo.content}</textarea>
                                    </div>
                                </div>

                                {if condition="$FeedbackInfo.status eq 1"}
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">回复时间：</label>
                                    <div class="col-sm-8">
                                        <input  type="text" class="form-control" readonly value="{$FeedbackInfo.back_time|date='Y-m-d H:i:s',###}">
                                    </div>
                                </div>
                                {/if}
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">回复内容：</label>
                                    <div class="col-sm-8">
                                        <textarea id="back_content" name="back_content" class="form-control" rows="8" {if condition="$FeedbackInfo.status eq 1"}readonly{/if}>{$FeedbackInfo.back_content}</textarea>
                                    </div>
                                </div>
                                {if condition="$FeedbackInfo.status eq 0"}
                                <div class="form-group">
                                    <div class="col-sm-8 col-sm-offset-3">
                                        <button class="btn btn-block btn-primary" type="button" id="sub">立即回复</button>
                                    </div>
                                </div>
                                {/if}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


</div>
<script src="__STATIC__/Admin/js/jquery-2.1.1.min.js"></script>
<script src="__STATIC__/Admin/js/bootstrap.min.js?v=3.4.0"></script>
<script src="__STATIC__/Admin/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="__STATIC__/Admin/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="__STATIC__/Admin/layer/layer.js"></script>
<script>

    $("#sub").on('click',function(){
        var id = "{$FeedbackInfo.id}";
        var back_content = $("#back_content").val();

        if(back_content == ''){
            layer.msg('请输入回复内容',{icon: 5,time:1500});
            return false;
        }

        $.ajax({
            type:"POST",
            url:"{:url('Feedback/FeedbackEdit')}",
            data:{
                id:id,
                back_content:back_content,
            },
            dataType:"json",
            success:function(data){
                if(data.status == 1){
                    layer.msg(data.message, {icon: 6,time:1500},function () {
                        window.top.location.reload();
                    });
                }else{
                    layer.msg(data.message,{icon: 5,time:1000});
                }
            }
        });
    })
</script>
</body>

</html>
